package com.bxmdm.ragdemo.dto;

import java.util.List;

/**
 * RAG检索结果的格式化返回对象
 */
public class RagSearchResult {
    private int count;
    private List<RagSearchItem> results;

    public RagSearchResult() {}

    public RagSearchResult(int count, List<RagSearchItem> results) {
        this.count = count;
        this.results = results;
    }

    // Getters and setters
    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public List<RagSearchItem> getResults() {
        return results;
    }

    public void setResults(List<RagSearchItem> results) {
        this.results = results;
    }

    /**
     * 单个RAG检索结果项
     */
    public static class RagSearchItem {
        private double similarity;
        private String question;
        private String answer;
        private List<String> otherAnswers;

        public RagSearchItem() {}

        public RagSearchItem(double similarity, String question, String answer, List<String> otherAnswers) {
            this.similarity = similarity;
            this.question = question;
            this.answer = answer;
            this.otherAnswers = otherAnswers;
        }

        // Getters and setters
        public double getSimilarity() {
            return similarity;
        }

        public void setSimilarity(double similarity) {
            this.similarity = similarity;
        }

        public String getQuestion() {
            return question;
        }

        public void setQuestion(String question) {
            this.question = question;
        }

        public String getAnswer() {
            return answer;
        }

        public void setAnswer(String answer) {
            this.answer = answer;
        }

        public List<String> getOtherAnswers() {
            return otherAnswers;
        }

        public void setOtherAnswers(List<String> otherAnswers) {
            this.otherAnswers = otherAnswers;
        }
    }
}
